home *** CD-ROM | disk | FTP | other *** search
- _____ __ __ ____ __ __ _ _
- / _ \ | \ / | | | | \ / | | | | |
- | / \__| | \/ | | | \ ~ / | | | |
- | \___ | | | | | | | | | |
- \___ \ | /\/\ | | | | | | | _ | |
- __ \ | | | | | | | | | | |/ \| |
- | \_/ | | | | | | | / ^ \ | _ |
- \_____/ |__| |__| |____| |__/ \__| \__/ \__/
-
- for Watcom C DOS/4GW protected mode
-
- Version 1.22
- Written by Ethan Brodsky (5/27/95)
- Copyright 1995 by Ethan Brodsky. All rights reserved.
-
- This library is distributed AS IS. The author specifically disclaims
- responsibility for any loss of profit or any consequential, incidental,
- or other damages. SMIXW is freeware and is distributed with full source
- code, which is copyright by Ethan Brodsky. You are free to incorporate
- the code in full or part into your own programs as long as credit is
- given to Ethan Brodsky. The source code may be distributed in its
- original form only, including this documentation and the copyright
- notices.
-
- ------------------------------------------------------------------------
-
- You may have used my SBVOX and SBDSP units. They both played one VOC
- file at a time. The whole VOC file had to be loaded into conventional
- memory, taking valuable memory from a real mode program.
-
- SMIXW will play up to 8 simultaneous sounds on a Sound Blaster or
- compatible in protected mode. The sounds are stored anywhere in memory
- and are mixed into a small buffer as needed. It uses auto initialized
- DMA if a SBPro or higher is installed, eliminating clicks between
- blocks. On a SB16 is installed, it will use 16-bit sound output,
- increasing the sound quality. Full source for Watcom C protected mode
- using the DOS/4GW extender is included.
-
- The sounds are stored on disk as raw signed 8-bit sample data at a
- sampling rate of 22050 HZ and are loaded anywhere in memory. The
- data is mixed into a 16-bit buffer one block at a time, then copied
- down to an 8 or 16 bit buffer in conventional memory for DMA output.
-
- Please test this on your setup (Especially if you have a Sound Blaster
- compatible or a configuration out of the ordinary) and report any
- incompatibilities to me. I have personally tested this version on my
- SB16 and SBPro, but I have received reports that it works on many SB
- compatibles.
-
- As the block size is increased, the sound latency will also increase.
- New sound effects are only started at the beginning of each block,
- so a block size of 512 gives a latency of about 1/43 of a second.
- This is the maximum time that can pass between when the StartSound
- procedure is called and when the sound starts playing. In case you are
- wondering about the three counters displayed by the test program, the
- first one counts in the CPU's free time, the second counts the number
- of interrupts that have occurred, and the third is the number of sounds
- currently being played. If you have an incompatibility problem, please
- tell me what each counter is doing.
-
- SMIXW uses a raw 8-bit unsigned file format. I have included a program
- that will convert WAV files to the raw format necessary. The WAV files
- must be 8-bit and sampled at 22050 HZ, or the output will be distorted.
-
- One important pointer: The SMIX module MUST be compiled using the "-zu"
- compiler switch. The Watcom code generator erroneously assumes that
- SS == DS when generating code for an interrupt handler. The compiler
- then uses EBP to address data in DS and your program will terminate
- with a stack fault upon the first sound interrupt. "-zu" tells the
- compiler not to make this assumption and is the best workaround for
- this compiler bug. (Another option is to disable optimizations, but
- then the compiler will generate terrible code) Due to the DOS/4GW
- extender used for Watcom C protected mode, sound cards on IRQ10 are
- not supported by this version of SMIX.
-
- I have several improvements planned, but I need feedback. If you are
- using my code, I would greatly appreciate it if you would mail me and
- tell me about it. If you have any bug reports, suggestions, or have
- made improvements, please tell me! I also have available a FM synthesis
- MIDI music library and am working on a digital music library, so tell me
- what you are interested in!
-
- This library is freeware, but I would appreciate contributions so I can
- continue to buy development kits and upgrade my computer. You don't
- NEED to send me anything, but if you are making money using this, please
- send whatever you feel that it is worth.
-
- Features:
- * Up to 8 sounds played simultaneously
- * Sampling rate of 22050 HZ
- * Autoinitialized DMA prevents clicking
- * 16-bit sound output increases quality
- * Mixes in the background using a fraction of CPU time
- * Sound volume control supported
-
- ------------------------------------------------------------------------
-
- There are several ways to contact me:
- E-Mail: ericbrodsky@psl.wisc.edu (Preferred)
- WWW: http://www.xraylith.wisc.edu/~ebrodsky/
- Phone: (608) 238-4830
- Mail:
- Ethan Brodsky
- 4010 Cherokee Dr.
- Madison, WI 53711
-
- Bug fixes and other announcements will be posted in:
- alt.sb.programmer
- comp.sys.ibm.pc.soundcard.tech
- rec.games.programmer
-
- Up-to-date versions may be downloaded from:
- x2ftp.oulu.fi /pub/msdos/programming/mxlibs/smixw*.zip
- The directory structure at x2ftp is currently under reorganization
- and the file will probably be moved to a different directory.
- http://www.xraylith.wisc.edu/~ebrodsky/smix/smix.html
-
- Revision history:
- 1.11 - Initial release
- 1.20 - Switched to a new mixing algorithm that doesn't reduce sound
- volume on 8-bit sound cards. Added support for sound volume
- control. Fixed a problem with output on Sound BlasterPros.
- Optimized mixing code. Modified code in exit procedure to
- reset sound card on termination.
- 1.21 - Modifed shutdown code
- 1.22 - Fixed a detection problem with sound cards on DMA0. Commented
- SMIX interface. Modified interrrupt acknowledgement. Added a
- sound_playing function to check if a sound is still playing.
-
- I've been looking to get in with a commercial software company. If any
- companies are interested, write to me at the above address. Thanks!
-
- Ethan Brodsky
-